<template>
	<view class="set">
		<view
			class="list-cell b-b"
			:class="{ 'm-t': item.class === 'mT' }"
			v-for="item in setList"
			:key="item.title"
			@tap="jump(item.url)"
			hover-class="cell-hover"
			:hover-stay-time="50"
		>
			<text class="cell-tit">{{ item.title }}</text>
			<text class="cell-tip">{{ item.content }}</text>
			<image src="../../../static/imgs/home/right.png" style="width: 16rpx;height: 26rpx;" mode=""></image>
		</view>
		<view class="list-cell log-out-btn">
			<text class="cell-tit" @tap="logout()">退出登录</text>
		</view>	
		</view>
	</view>
</template>
<script>

export default {
	data() {
		return {	
			setList: [
				{
					title: '个人资料',
					url: '/pages/user/set/info',
					content: ''
				},
				{
					title: '修改登录密码',
					url: '/pages/login/forgetPwd',
					content: ''
				},
				{
					title: '修改交易密码',
					url: '/pages/user/set/changePayPsd',
					content: ''
				}
			],
		};
	},
	onLoad() {
		// #ifdef APP-PLUS
		if (uni.getSystemInfoSync().platform === 'ios') {
			this.CustomBar = 0;
		}
		// #endif
	},
	methods: {
		// 退出登录
		logout() {
			this.$api.logina().then(res => {
				if (res.ok) {
					this.$msg(res.msg);
					uni.removeStorageSync("token");
					uni.removeStorageSync("uid");
					uni.removeStorageSync("effective");
					uni.removeStorageSync('supperNodeName');
					uni.removeStorageSync('walleturl');
					uni.removeStorageSync('fee');
					uni.removeStorageSync('digitalMoney');
					uni.removeStorageSync('kaffect');
					uni.removeStorageSync('countwallet');
					uni.removeStorageSync('cnywallet'); //人民币
					uni.removeStorageSync('digitalwallet'); //数字货币
					uni.removeStorageSync('lockcnywallet');
					uni.removeStorageSync('lockdigitalwallet'); 
					setTimeout(()=>{
						uni.reLaunch({
							url:'/pages/login/login'
						})
					}, 1000)
				}
			});
		}
	}
};
</script>
<style lang="scss">
page {
	background: $page-color-base;
}
.set {
	padding:30rpx 0;
}

.cu-list.card-menu {
	margin:30rpx 0;
	.title {
		margin-left: 30rpx;
	}
}
.list-cell {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: baseline;
    -webkit-align-items: baseline;
    align-items: baseline;
    padding: 10px 15px;
    line-height: 30px;
    position: relative;
    background: #fff;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}
.list-cell .cell-tit {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    font-size: 15px;
    margin-right: 5px;
}
.list-cell.log-out-btn {
    margin: 20px 0;
}
.list-cell.log-out-btn .cell-tit {
    text-align: center;
    margin-right: 0;
}

.list-cell .cell-tit {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    font-size: 15px;
    margin-right: 5px;
}
</style>
